<%@ page language="java" pageEncoding="us-ascii" contentType="text/html;charset=us-ascii" %>
<%--Copyright (C) 2011 Wolfgang Hankeln, Norma J. Wendel
	 
	This file is part of CDinFusion.
	
	CDinFusion is free software: you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public 
	License in version 3 (LGPL3) as published by the Free Software
	Foundation version 3 of the License.
	
	CDinFusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	Lesser General Public License for more details.
	
	You should have received a copy of the Lesser General Public
	License along with CDinFusion; see the file COPYING. If not,
	write to the Free Software Foundation, 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA or see <http://www.gnu.org/licenses/>.
	
	If you have any questions, send an email to: megx@mpi-bremen.de.
--%>

<%@ page import="org.cdinfusion.data.*"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%System.out.println("<<<<<<<<<<CSV_CREATION>>>>>>>>>>");%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>

<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<style type="text/css">
</style>
<title>DOWNLOAD EMPTY CSV FILE</title>
<jsp:include page="googleanalytics.jsp"/>
</head>
<body>
<table border="0" width="100%" bgcolor="#2B3990" cellpadding=0 cellspacing=0>
<tr bgcolor="#ffffff">
<td width=250>
<center>
<img height="81" width="250" alt="CDinFusion Logo" src="/CDinFusion/img/logo_small_dark.png">
</center>
</td>
</tr>

<tr align="left">    
<td>
<jsp:include page="documentation/navigation.jsp"></jsp:include>
</td>
</tr>

<tr bgcolor="#ffffff">
<td>
<div class="center_div">
<br>
<%
String origin = (String)session.getAttribute("origin");
String sessionID = request.getSession().getId();
String context_exists = (String) session.getAttribute("context_exists");
if(context_exists.equals("yes")){
	List<CDElement> oldLIST = (List<CDElement>) session.getAttribute("cdeLIST");
	session.setAttribute("oldLIST", oldLIST);
}
List<CDElement> cdeLIST = (List<CDElement>) session.getAttribute("cdeLIST");

if(origin.equals("3b1")|origin.equals("3b2")|origin.equals("cd_change")){
	List<String> sSeqID = (List<String>) request.getAttribute("sSeqID");
	session.setAttribute("sSeqID", sSeqID);
	List<String> uSeqID = (List<String>) request.getAttribute("uSeqID");
	session.setAttribute("uSeqID", uSeqID);
}
%>
<center><b>Download csv file</b> <br>
<% if(origin.equals("2a")|origin.equals("2b")|origin.equals("3b1")){ %>
	Please download the empty csv file and save it, to fill the values:
	<a href="/CDinFusion/data/<%out.print(sessionID);%>.csv" name="sheet">
		<button class="submitbutton" style="height:30px;" type="button" value="StructuredCommentFile"> 
		<img height="18" width="18" src="/CDinFusion/img/disc_smaller.png" alt="">EmptyCSVFile</button></a>
	<form action="CSV2GSCController.htm" method="post">
		<% 
		if(origin.equals("2a")){
			origin = "2a_csv";
			%>
		<%}
		if(origin.equals("2b")){
			origin = "2b_csv";
			%>
		<%}
		if(origin.equals("3b1")){
			origin = "3b1_csv";
			%>
		<%}
		session.setAttribute("origin", origin);
		%>
		<input class="submitbutton" type="submit" value="proceed">
	</form>
<%} /*end if(origin.equals("2a").....)*/

if(origin.equals("3a")|origin.equals("3b")){
	%>
	Please download the filled csv file and save it:
	<%System.out.println("destination: Links to FilledCSVFile");%>
	<a href="/CDinFusion/data/<%out.print(sessionID);%>_filled.csv" name="sheet">
		<button class="submitbutton" style="height:30px;" type="button" value="StructuredCommentFile">
		<img height="18" width="18" src="/CDinFusion/img/disc_smaller.png" alt="">FilledCSVFile</button></a>
	<form action="Filled2InputController.htm" method="post">
		<%
		if(origin.equals("3a")){
			origin = "3a_csv";
		}else{
			origin = "3b_csv";
		}
		session.setAttribute("origin", origin);
		%>
		<input class="submitbutton" type="submit" value="proceed">
	</form>
<%} //end if(origin.equals("3a"))
if(origin.equals("3b2")|origin.equals("cd_change")){%>
	Please download the filled csv file and save it:
	<a href="/CDinFusion/data/<%out.print(sessionID);%>_filled.csv" name="sheet">
		<button class="submitbutton" style="height:30px;" type="button" value="StructuredCommentFile">
		<img height="18" width="18" src="/CDinFusion/img/disc_smaller.png" alt="">FilledCSVFile</button></a>
	<form action="Filled2InputController.htm" method="post">
		<%
		if(origin.equals("3b2")){
			origin = "3b2_csv";
		}else{
			origin = "cd_change";
		}
		
		session.setAttribute("origin", origin);
		%>
		<input class="submitbutton" type="submit" value="proceed">
	</form>
<%} //end if(origin.equals("3b2")|origin.equals("cd_change"))
%>
</center>
</div>
</td>
</tr>
<tr bgcolor="#ffffff"><td align="right" height=30>
<%
if(origin.equals("2a")|origin.equals("2b")|origin.equals("3b1")){%>
	<img height="20" width="200" alt="CDinFusion Step 2" src="/CDinFusion/img/step2.png">
<%}
if(origin.equals("3b2") | origin.equals("3a")){%>
	<img height="20" width="200" alt="CDinFusion Step 3" src="/CDinFusion/img/step3.png">
<%}%>
</td></tr>
<jsp:include page="documentation/bottom_info.jsp"></jsp:include>
</table>
</body>
</html>